package com.xiaoyu.izf.repository;

import com.xiaoyu.izf.model.MerchantInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface MerchantInfoDao extends JpaRepository<MerchantInfo,Integer>, JpaSpecificationExecutor<MerchantInfo> {

    MerchantInfo findByLinkmanMobile(String mobile);
    MerchantInfo findByMerchantName(String merchantName);
    MerchantInfo findByMerchantSimpleName(String simpleName);
    public MerchantInfo findOneByMerchantNameAndLinkmanMobile(String merchantName,String linkmanMobile);

    @Query(value = "from MerchantInfo where id=:id")
    MerchantInfo oneById(@Param("id") int id);
}
